<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.min.js"></script>
</head>

<body>
    <div id="app">
        <input type="button" value="点击按钮" v-on:click="show" />
        <input type="button" value="点击按钮" @click="show" />
        <input type="button" value="双击按钮" @dblclick="show" />

        <h2 @click="changeFood">{{food}}</h2>
    </div>
</body>
<script>
    var VM = new Vue({
        el: '#app',
        data: {
            food: "肉蛋葱鸡"
        },
        //methods存放Vue的方法
        methods: {
            show: function() {
                alert("卢本伟牛逼！");
            },
            changeFood: function() {
                this.food += "真好吃";
            }
        }
    })
</script>

</html>